The present disclosure relates to a tractor having a power takeoff and a method of controlling the power take-off and generating electricity.